<template>
	<view class="container">
		<!-- <web-view  src="/hybrid/html/local.html" @message="message"></web-view> -->
		<!-- #ifdef APP-PLUS -->
		<web-view :src="webViewUrl" @message="message"></web-view>
		<!-- #endif -->
		<!-- #ifdef H5 -->
		<!-- <web-view :src="webViewUrl" @message="message"></web-view> -->
		<!-- <iframe style="width: 100vw;height: 100vh;" :src="webViewUrl" frameborder="0"></iframe> -->
		<!-- #endif -->

	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {},
				webViewUrl: '/hybrid/html/local.html',
			};
		},
		onLoad(option) {
			// console.log(option,'option')

			// console.log(this.form, 'form')



			if (option.url && option.type == 4) {
				this.webViewUrl = option.url
			} else if (option.form) {
				this.form = JSON.parse(option.form)
				this.webViewUrl = `/hybrid/html/local2.html?form=${encodeURIComponent(JSON.stringify(this.form))}`
			} else if (option.type == 1) {
				this.form = JSON.parse(option.payData)
				this.webViewUrl = `/hybrid/html/local.html?form=${encodeURIComponent(JSON.stringify(this.form))}`
			} else if (option.type == 9) {
				this.form = JSON.parse(option.AppleForm)
				this.webViewUrl = `/hybrid/html/local9.html?form=${encodeURIComponent(JSON.stringify(this.form))}`
			}

			// #ifdef H5
			window.location.href = this.webViewUrl
			// #endif


		},
		created(option) {

			// this.webViewUrl = `/hybrid/html/local.html?form=${encodeURIComponent(JSON.stringify(this.form))}`
		},
		methods: {
			message() {

			}
		}
	}
</script>

<style lang="less">
	.container {
		width: 100vw;
		height: 100vh;
	}
</style>